<template>
  <el-form :model="userForm" ref="userFormRef" :rules="userRules" size="default" label-width="170px">
    <el-row :gutter="20" type="flex" style="flex-wrap: wrap;margin: 20px;">
      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 18px;font-weight: bold;line-height: 36px;">基本信息</span>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="24">
        <el-form-item prop="organizationBaseName" label="组织名称">
          <el-input placeholder="请输入" v-model="userForm.organizationBaseName"></el-input>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="supervisoryCode" label="业务主管单位">
          <el-select clearable v-model="userForm.supervisoryCode" placeholder="请选择业务主管单位" style="width: 100%;"
            filterable>
            <el-option v-for="item in authorityOptions" :key="item.deptId" :label="item.deptName" :value="item.deptId">
            </el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="industryType" label="行业分类">
          <el-select clearable v-model="userForm.industryType" placeholder="请选择行业分类" style="width: 100%;">
            <el-option v-for="item in industryClassOptions" :key="item.id" :label="item.name" :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="leadershipOrganization" label="党建领导机关">
          <el-input placeholder="请输入" v-model="userForm.leadershipOrganization" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="unitNature" label="社会组织类型">
          <el-select clearable v-model="userForm.unitNature" placeholder="请选择社会组织类型" style="width: 100%;">
            <el-option v-for="item in socialOrganizationTypeOptions" :key="item.id" :label="item.name" :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="creditCode" label="统一社会信用代码">
          <el-input placeholder="请输入" v-model="userForm.creditCode"></el-input>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="registerNum" label="原登记证号">
          <el-input placeholder="请输入" v-model="userForm.registerNum" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="establishTime" label="注册时间">
          <el-date-picker value-format="YYYY-MM-DD" style="width:100%;" v-model="userForm.establishTime" type="date"
            placeholder="选择出生日期">
          </el-date-picker>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="registerCapital" label="注册资金">
          <el-input placeholder="请输入" type="number" v-model="userForm.registerCapital">
            <template #append>万元</template>
          </el-input>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="registerAddress" label="住所">
          <el-input placeholder="请输入" v-model="userForm.registerAddress" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="postalCode" label="邮政编码">
          <el-input placeholder="请输入" type="number" v-model="userForm.postalCode" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="officePhone" label="办公电话">
          <el-input placeholder="请输入" type="number" v-model="userForm.officePhone" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="foreignPhone" label="对外公开电话">
          <el-input placeholder="请输入" type="number" v-model="userForm.foreignPhone" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="websiteAddress" label="网站地址">
          <el-input placeholder="请输入" v-model="userForm.websiteAddress" />
        </el-form-item>

      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="email" label="电子邮件">
          <el-input placeholder="请输入" v-model="userForm.email" />
        </el-form-item>

      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="contactsName" label="联系人姓名">
          <el-input placeholder="请输入" v-model="userForm.contactsName" />
        </el-form-item>

      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="contactsPost" label="联系人职务">
          <el-select clearable v-model="userForm.contactsPost" placeholder="请选择职务" style="width: 100%;">
            <el-option v-for="item in clubPositionsOptions" :key="item.id" :label="item.name" :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>

      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="contactsTelephone" label="联系方式">
          <el-input placeholder="请输入" type="number" v-model="userForm.contactsTelephone" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="unitMemberNum" label="单位会员数量">
          <el-input placeholder="请输入" type="number" v-model="userForm.unitMemberNum" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="personalMemberNum" label="个人会员数量">
          <el-input placeholder="请输入" type="number" v-model="userForm.personalMemberNum" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="rulesProvidePowerDept" label="章程规定最高权力机构">
          <el-radio-group v-model="userForm.rulesProvidePowerDept" size="default">
            <el-radio :label="1">会员大会</el-radio>
            <el-radio :label="2">会员代表大会</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12" v-if="userForm.rulesProvidePowerDept == 2">
        <el-form-item prop="representativeMemberNum" label="会员代表人数">
          <el-input placeholder="请输入" type="number" v-model="userForm.representativeMemberNum" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="24">
        <el-form-item prop="businessScope" label="业务范围">
          <el-input type="textarea" placeholder="请输入" v-model="userForm.businessScope"></el-input>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 18px;font-weight: bold;line-height: 36px;">法定代表人</span>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="legalRepresentativeName" label="姓名">
          <el-input placeholder="请输入" v-model="userForm.legalRepresentativeName" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="legalRepresentativeSex" label="性别">
          <el-select clearable style="width:100%;" v-model="userForm.legalRepresentativeSex" placeholder="请选择性别">
            <el-option v-for="item in sexOptions" :key="item.id" :label="item.name" :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="legalRepresentativeBirthday" label="出生日期">
          <el-date-picker value-format="YYYY-MM-DD" style="width:100%;" v-model="userForm.legalRepresentativeBirthday"
            type="date" placeholder="选择出生日期">
          </el-date-picker>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="legalRepresentativePolitics" label="政治面貌">
          <el-select clearable v-model="userForm.legalRepresentativePolitics" placeholder="请选择政治面貌"
            style="width: 100%;">
            <el-option v-for="item in politicsOptions" :key="item.id" :label="item.name" :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="legalRepresentativeEducation" label="学历">
          <el-select clearable v-model="userForm.legalRepresentativeEducation" placeholder="请选择学历" style="width: 100%;">
            <el-option v-for="item in xueliOptions" :key="item.id" :label="item.name" :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="legalRepresentativePost" label="法定代表人职务">
          <el-select clearable v-model="userForm.legalRepresentativePost" placeholder="请选择社团职务" style="width: 100%;">
            <el-option v-for="item in clubPositionsOptions" :key="item.id" :label="item.name" :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 18px;font-weight: bold;line-height: 36px;">是否合署办公</span>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="isJoinWork" label="是否合署办公">
          <el-radio-group v-model="userForm.isJoinWork" size="default">
            <el-radio :label="1">是</el-radio>
            <el-radio :label="2">否</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12" v-if="userForm.isJoinWork == 1">
        <el-form-item prop="joinWork" label="合署办公的单位名称">
          <el-input placeholder="请输入" v-model="userForm.joinWork" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 18px;font-weight: bold;line-height: 36px;">理事会及负责人</span>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="directorPeopleNum" label="理事会人数">
          <el-input disabled v-model="userForm.directorPeopleNum" style="width: 100%;" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="executiveDirectorPeopleNum" label="常务理事会人数">
          <el-input placeholder="请输入" type="number" v-model="userForm.executiveDirectorPeopleNum"
            style="width: 100%;" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="responsiblePeopleNum" label="负责人数">
          <el-input disabled v-model="userForm.responsiblePeopleNum" style="width: 100%;" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="responsibleSeventyPeopleNum" label="70岁以上负责人数">
          <el-input v-model="userForm.responsibleSeventyPeopleNum" style="width: 100%;" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 16px;font-weight: bold;line-height: 36px;">理事长(会长)</span>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="chairmanName" label="姓名">
          <el-input placeholder="请输入" v-model="userForm.chairmanName" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="chairmanPhone" label="联系方式">
          <el-input placeholder="请输入" type="number" v-model="userForm.chairmanPhone" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="chairmanAppointTime" label="任职时间">
          <el-date-picker v-model="userForm.chairmanAppointTime" style="width: 100%;" value-format="YYYY-MM-DD"
                          type="date" placeholder="请选择时间">
          </el-date-picker>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="chairmanDirectorUnitPosition" label="(原)工作单位及职务">
          <el-input placeholder="请输入" v-model="userForm.chairmanDirectorUnitPosition" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 16px;font-weight: bold;line-height: 36px;">秘书长</span>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="secretaryName" label="姓名">
          <el-input placeholder="请输入" v-model="userForm.secretaryName" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="secretaryPhone" label="联系方式">
          <el-input placeholder="请输入" type="number" v-model="userForm.secretaryPhone" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="secretaryAppointTime" label="任职时间">
          <el-date-picker v-model="userForm.secretaryAppointTime" style="width: 100%;" value-format="YYYY-MM-DD"
                          type="date" placeholder="请选择时间">
          </el-date-picker>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="secretaryDirectorGenerateWay" label="秘书长产生方式">
          <el-select clearable v-model="userForm.secretaryDirectorGenerateWay" placeholder="请选择产生方式"
            style="width: 100%;">
            <el-option v-for="item in secretaryPromotionOptions" :key="item.id" :label="item.name" :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="secretaryDirectorFullTime" label="是否专职">
          <el-radio-group v-model="userForm.secretaryDirectorFullTime" size="default">-->
            <el-radio :label="1">是</el-radio>
            <el-radio :label="2">否</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 18px;font-weight: bold;line-height: 36px;">新闻发言人</span>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="spokesmanName" label="姓名">
          <el-input placeholder="请输入" v-model="userForm.spokesmanName" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="spokesmanPost" label="社团职务">
          <el-select clearable v-model="userForm.spokesmanPost" placeholder="请选择社团职务" style="width: 100%;">
            <el-option v-for="item in clubPositionsOptions" :key="item.id" :label="item.name" :value="item.id">
            </el-option>
          </el-select>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="spokesmanPhone" label="电话">
          <el-input placeholder="请输入" type="number" v-model="userForm.spokesmanPhone" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 16px;font-weight: bold;line-height: 36px;">现职公务员兼任负责人</span>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="incumbentResponsibleMinisterialNum" label="省部级及以上人数">
          <el-input disabled v-model="userForm.incumbentResponsibleMinisterialNum" style="width: 100%;" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="incumbentResponsibleDepartmentNum" label="地厅级人数">
          <el-input disabled v-model="userForm.incumbentResponsibleDepartmentNum" style="width: 100%;" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="incumbentResponsibleCountyNum" label="县处级人数">
          <el-input disabled v-model="userForm.incumbentResponsibleCountyNum" style="width: 100%;" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 16px;font-weight: bold;line-height: 36px;">退（离）休领导干部担任负责人</span>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="retireResponsibleMinisterialNum" label="兼任省部级及以上人数">
          <el-input disabled v-model="userForm.retireResponsibleMinisterialNum" style="width: 100%;" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="retireResponsibleDepartmentNum" label="兼任地厅级人数">
          <el-input disabled v-model="userForm.retireResponsibleDepartmentNum" style="width: 100%;" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="retireResponsibleCountyNum" label="兼任县处级人数">
          <el-input disabled v-model="userForm.retireResponsibleCountyNum" style="width: 100%;" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 16px;font-weight: bold;line-height: 36px;">退（离）休领导干部担任理事数</span>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="retireDirectorMinisterialNum" label="省部级及以上人数">
          <el-input disabled v-model="userForm.retireDirectorMinisterialNum" style="width: 100%;" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="retireDirectorDepartmentNum" label="地厅级人数">
          <el-input disabled v-model="userForm.retireDirectorDepartmentNum" style="width: 100%;" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="retireDirectorCountyNum" label="县处级人数">
          <el-input disabled v-model="userForm.retireDirectorCountyNum" style="width: 100%;" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 18px;font-weight: bold;line-height: 36px;">党建工作情况</span>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="partyMembersNum" label="党员数">
          <el-input placeholder="请输入" disabled v-model="userForm.partyMembersNum" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="partyOrganization" label="是否建立党组织">
          <el-radio-group disabled v-model="userForm.partyOrganization" size="default">
            <el-radio :label="1">是</el-radio>
            <el-radio :label="2">否</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="partyBuildSocialistCoreValuesConstitution" label="是否将党的建设和社会主义核心价值观写入章程">
          <el-radio-group disabled v-model="userForm.partyBuildSocialistCoreValuesConstitution" size="default">
            <el-radio :label="1">是</el-radio>
            <el-radio :label="2">否</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 18px;font-weight: bold;line-height: 36px;">群团工作情况</span>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="teamActivitieNum" label="群团组织活动次数">
          <el-input disabled v-model="userForm.teamActivitieNum" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="establishingTradeUnions" label="是否建立工会">
          <el-radio-group disabled v-model="userForm.establishingTradeUnions" size="default">
            <el-radio :label="1">是</el-radio>
            <el-radio :label="2">否</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="establishingTeam" label="是否建立团组织">
          <el-radio-group disabled v-model="userForm.establishingTeam" size="default">
            <el-radio :label="1">是</el-radio>
            <el-radio :label="2">否</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="establishingWomenFederation" label="是否建立妇联">
          <el-radio-group disabled v-model="userForm.establishingWomenFederation" size="default">
            <el-radio :label="1">是</el-radio>
            <el-radio :label="2">否</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-col>

      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 18px;font-weight: bold;line-height: 36px;">机构设置</span>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="branchNum" label="分支机构数">
          <el-input disabled v-model="userForm.branchNum" />
        </el-form-item>
      </el-col>

      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="representativeNum" label="代表机构数">
          <el-input disabled v-model="userForm.representativeNum" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="workNum" label="办事机构数">
          <el-input disabled v-model="userForm.workNum" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="entityNum" label="实体机构数">
          <el-input disabled v-model="userForm.entityNum" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="newBranchNum" label="其中本年度新设立分支（代表）机构数">
          <el-input placeholder="请输入" type="number" v-model="userForm.newBranchNum" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="23">
        <span style="font-size: 18px;font-weight: bold;line-height: 36px;">相关收支、职能和本年度重大活动情况</span>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="membershipFees" label="会费收入" label-width="180px">
          <el-input placeholder="请输入" v-model="userForm.membershipFees" />
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="countryRevitalization" label="是否参与乡村振兴工作" label-width="180px">
          <el-radio-group disabled v-model="userForm.countryRevitalization" size="default">
            <el-radio :label="1">是</el-radio>
            <el-radio :label="2">否</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="publicWelfareCharitableNum" label="举办公益慈善活动" label-width="180px">
          <el-input disabled v-model="userForm.publicWelfareCharitableNum" style="width: 100%;">
            <template #append>项</template>
          </el-input>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="lawsFunctionNum" label="法律法规规章中明确规定的职能" label-width="180px">
          <el-input disabled v-model="userForm.lawsFunctionNum" style="width: 100%;">
            <template #append>项</template>
          </el-input>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="administrationAuthorizationNum" label="行政机关委托授权的事项" label-width="180px">
          <el-input disabled v-model="userForm.administrationAuthorizationNum" style="width: 100%;">
            <template #append>项</template>
          </el-input>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="expositionTransactionNum" label="举办展览会、博览会、交易会活动" label-width="180px">
          <el-input disabled v-model="userForm.expositionTransactionNum" style="width: 100%;">
            <template #append>项</template>
          </el-input>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="workshopForumActivitiesNum" label="举办研讨会、论坛活动" label-width="180px">
          <el-input disabled v-model="userForm.workshopForumActivitiesNum" style="width: 100%;">
            <template #append>项</template>
          </el-input>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="evaluationCommendationNum" label="经批准举办评比达标表彰活动" label-width="180px">
          <el-input disabled v-model="userForm.evaluationCommendationNum" style="width: 100%;">
            <template #append>项</template>
          </el-input>
        </el-form-item>
      </el-col>
      <el-col style="margin-bottom: 15px;" :span="12">
        <el-form-item prop="trainAuthenticationAppraisalNum" label="举办培训、职审、认证、鉴定等活动" label-width="180px">
          <el-input disabled v-model="userForm.trainAuthenticationAppraisalNum" style="width: 100%;">
            <template #append>项</template>
          </el-input>
        </el-form-item>
      </el-col>
    </el-row>
  </el-form>
</template>
<script>

import { getDictByCode, getTableInfoByPage, stSaveBase } from '@/views/yearCheck/ykb/st/st'
import { getAuthorityDept, getListAuthority } from '@/views/yearCheck/ykb/mf/mf'

export default {
  data() {
    return {
      sexOptions: [{ id: 1, name: '男' }, { id: 2, name: '女' }],
      shiOptions: [{ id: '1', name: '是' }, { id: '2', name: '否' }],
      socialOrganizationTypeOptions: undefined,
      typeValue: '1',
      politicsOptions: undefined,
      xueliOptions: undefined,
      secretaryPromotionOptions: undefined,
      clubPositionsOptions: undefined,
      industryClassOptions: undefined,
      authorityOptions: [],
      userRules: {
        businessScope: [{ required: true, message: '请完善', trigger: 'blur' }],
        chairmanAppointTime: [{ required: true, message: '请完善', trigger: 'blur' }],
        chairmanDirectorUnitPosition: [{ required: true, message: '请完善', trigger: 'blur' }],
        chairmanName: [{ required: true, message: '请完善', trigger: 'blur' }],
        chairmanPhone: [{ required: true, message: '请完善', trigger: 'blur' }, {
          validator: this.validatePhoneNumber,
          trigger: 'blur'
        }],
        contactsPhone: [{ required: true, message: '请完善', trigger: 'blur' }],
        // contactsTelephone: [{
        //   required: true,
        //   message: '请完善',
        //   trigger: 'blur'
        // }, { validator: this.validatePhoneNumber, trigger: 'blur' }],
        // email: [{
        //   required: true,
        //   message: '请完善',
        //   trigger: 'blur'
        // }, {
        //   pattern: /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/,
        //   message: '邮箱格式不正确',
        //   trigger: 'blur'
        // }],
        establishTime: [{ required: true, message: '请选择', trigger: 'blur' }],
        executiveDirectorPeopleNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        incumbentResponsibleClerkNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        industryType: [{ required: true, message: '请选择', trigger: 'blur' }],
        isJoinWork: [{ required: true, message: '请选择', trigger: 'blur' }],
        leadershipOrganization: [{ required: true, message: '请完善', trigger: 'blur' }],
        legalRepresentativeBirthday: [{ required: true, message: '请选择', trigger: 'blur' }],
        legalRepresentativeEducation: [{ required: true, message: '请选择', trigger: 'blur' }],
        legalRepresentativeName: [{ required: true, message: '请完善', trigger: 'blur' }],
        legalRepresentativePolitics: [{ required: true, message: '请选择', trigger: 'blur' }],
        legalRepresentativePost: [{ required: true, message: '请选择', trigger: 'blur' }],
        legalRepresentativeSex: [{ required: true, message: '请选择', trigger: 'blur' }],
        // membershipFees: [{ required: true, message: '请完善', trigger: 'blur' }],
        newBranchNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        organizationBaseName: [{ required: true, message: '请完善', trigger: 'blur' }],
        postalCode: [{ required: true, message: '请完善', trigger: 'blur' }, {
          pattern: /^[1-9]\d{5}$/,
          message: '邮编格式不正确',
          trigger: 'blur'
        }],
        registerAddress: [{ required: true, message: '请完善', trigger: 'blur' }],
        registerCapital: [{ required: true, message: '请完善', trigger: 'blur' }],
        // registerNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        retireDirectorClerkNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        retireResponsibleClerkNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        // secretaryAppointTime: [{ required: true, message: '请完善', trigger: 'blur' }],
        // secretaryDirectorFullTime: [{ required: true, message: '请选择', trigger: 'blur' }],
        // secretaryDirectorGenerateWay: [{ required: true, message: '请选择', trigger: 'blur' }],
        // secretaryName: [{ required: true, message: '请完善', trigger: 'blur' }],
        // secretaryPhone: [{ required: true, message: '请完善', trigger: 'blur' }, {
        //   validator: this.validatePhoneNumber,
        //   trigger: 'blur'
        // }],
        // spokesmanName: [{ required: true, message: '请完善', trigger: 'blur' }],
        // spokesmanPhone: [{ required: true, message: '请完善', trigger: 'blur' }, {
        //   validator: this.validatePhoneNumber,
        //   trigger: 'blur'
        // }],
        // spokesmanPost: [{ required: true, message: '请选择', trigger: 'blur' }],
        supervisoryCode: [{ required: true, message: '请选择', trigger: 'blur' }],
        supervisoryPhone: [{ required: true, message: '请完善', trigger: 'blur' }],
        unitNature: [{ required: true, message: '请选择', trigger: 'blur' }],
        // websiteAddress: [{ required: true, message: '请完善', trigger: 'blur' }],
        unitMemberNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        personalMemberNum: [{ required: true, message: '请完善', trigger: 'blur' }],
        contactsName: [{ required: true, message: '请完善', trigger: 'blur' }],
        contactsPost: [{ required: true, message: '请选择', trigger: 'blur' }],
        // foreignPhone: [{ required: true, message: '请完善', trigger: 'blur' }, {
        //   validator: this.validatePhoneNumber,
        //   trigger: 'blur'
        // }],
        // officePhone: [{ required: true, message: '请完善', trigger: 'blur' }, {
        //   validator: this.validatePhoneNumber,
        //   trigger: 'blur'
        // }],
        rulesProvidePowerDept: [{ required: true, message: '请选择', trigger: 'blur' }]
      },
      userForm: {
        administrationAuthorizationNum: '',//行政机关委托授权的事项数
        branchNum: '',//分支机构数
        businessScope: '',//业务范围
        chairmanAppointTime: '',//理事长任职时间
        chairmanDirectorUnitPosition: '',//理事长单位及职务/原单位/社会组织职务
        chairmanName: '',//理事长姓名
        chairmanPhone: '',//理事长联系方式
        contactsPhone: '',//联系人手机
        contactsTelephone: '',//联系人电话
        countryRevitalization: '',//是否参与乡村振兴工作 0-未知、1-是 2-否
        creditCode: localStorage.getItem('creditCode'),//统一社会信用代码
        directorPeopleNum: '',//理事人数
        email: '',//电子邮箱
        entityNum: '',//实体机构数
        establishTime: '',//($date-time)成立时间
        establishingTeam: '',//是否建立团组织 0-未知、1-是 2-否
        establishingTradeUnions: '',//是否建立工会 0-未知、1-是 2-否
        establishingWomenFederation: '',//是否建立妇联 0-未知、1-是 2-否
        evaluationCommendationNum: '',//经批准举办评比达标表彰活动数
        examineYear: localStorage.getItem('examineYear'),//申报年度
        executiveDirectorPeopleNum: '',//常务理事人数
        expositionTransactionNum: '',//举办展览会、博览会、交易会活动数
        id: '',//
        incumbentResponsibleClerkNum: '',//现任负责人县处级人数
        incumbentResponsibleCountyNum: '',//现任负责人县处级人数
        incumbentResponsibleDepartmentNum: '',//现任负责人厅级人数
        incumbentResponsibleMinisterialNum: '',//现任负责人部级人数
        industryType: '',//行业分类
        isJoinWork: '',//是否合署办公：0-未知、1-是、2-否
        joinWork: '',//合署办公单位名称
        lawsFunctionNum: '',//法律法规规章中明确规定的职能数
        leadershipOrganization: '',//党建领导机关
        legalRepresentativeBirthday: '',//($date-time)
        legalRepresentativeEducation: '',//法定代表人学历
        legalRepresentativeName: '',//法定代表人
        legalRepresentativePolitics: '',//法定代表人政治面貌
        legalRepresentativePost: '',//法定代表人职务
        legalRepresentativeSex: '',//法定代表人性别1-男，2-女 0-未知
        membershipFees: '',//会费收入
        newBranchNum: '',//年度新设分支/代表机构数
        organizationBaseName: '',//组织机构名称
        partyBuildSocialistCoreValuesConstitution: '',//是否将党的建设和社会主义核心价值观写入章程 0-未知、1-是 2-否
        partyMembersNum: '',//党员数
        partyOrganization: '',//是否建立党组织 0-未知、1-是 2-否
        postalCode: '',//邮政编码
        publicWelfareCharitableNum: '',//举办公益活动次数
        registerAddress: '',//住所/注册地址
        registerCapital: '',//注册资金
        registerNum: '',//登记证号
        representativeNum: '',//代表机构数
        responsiblePeopleNum: '',//负责人数
        responsibleSeventyPeopleNum: '',//70岁以上负责人数
        retireDirectorClerkNum: '',//退休理事科员处级人数
        retireDirectorCountyNum: '',//退休理事县处级人数
        retireDirectorDepartmentNum: '',//退休理事厅级人数
        retireDirectorMinisterialNum: '',//退休理事部级人数
        retireResponsibleClerkNum: '',//退休负责人科员级人数
        retireResponsibleCountyNum: '',//退休负责人县处级人数
        retireResponsibleDepartmentNum: '',//退休负责人厅级人数
        retireResponsibleMinisterialNum: '',//退休负责人部级人数
        secretaryAppointTime: '',//秘书长任职时间
        secretaryDirectorFullTime: '',//秘书长-专职/兼职
        secretaryDirectorGenerateWay: '',//秘书长产生方式
        secretaryName: '',//秘书长姓名
        secretaryPhone: '',//秘书长联系方式
        spokesmanName: '',//新闻发言人-姓名
        spokesmanPhone: '',//新闻发言人-电话
        spokesmanPost: '',//新闻发言人-职务
        supervisoryCode: '',//主管单位编码
        supervisoryPhone: '',//主管单位电话
        supervisoryUnit: '',//主管单位
        teamActivitieNum: '',//群团组织活动次数
        trainAuthenticationAppraisalNum: '',//举办培训、职称评审、认证、鉴定等活动数
        unitNature: '',//单位性质
        websiteAddress: '',//网站地址
        workNum: '',//办事机构数
        workshopForumActivitiesNum: '',//举办研讨会、论坛活动数
        unitMemberNum: '',//单位会员人数
        personalMemberNum: '',//个人会员人数
        representativeMemberNum: '',//会员代表大会人数
        contactsName: '',//联系人姓名
        contactsPost: '',//联系人职务
        foreignPhone: '',//对外电话
        officePhone: '',//办公电话
        rulesProvidePowerDept: ''//章程规定的最高权力机构
      }
    }
  },
  created() {
  },
  methods: {
    validatePhoneNumber(rule, value, callback) {
      // 座机号正则（这里仅作为示例，具体根据实际座机号规则设置）
      const telReg = /^(\d{3,4}-)?\d{7,9}$/
      // 手机号正则（中国大陆）
      const phoneReg = /^1[3-9]\d{9}$/

      if (!telReg.test(value) && !phoneReg.test(value)) {
        callback(new Error('请输入有效的手机号或座机号'))
      } else {
        callback()
      }
    },
    postInfo() {

      for (let i = 0; i < this.authorityOptions.length; i++) {
        if (this.authorityOptions[i].deptId == this.userForm.supervisoryCode) {
          this.userForm.supervisoryUnit = this.authorityOptions[i].deptName
        }
      }
      this.userForm.creditCode = localStorage.getItem("creditCode");
      this.userForm.examineYear = localStorage.getItem("examineYear");
      this.$refs.userFormRef.validate(valid => {
        let isSupervisory = false;
        for (let i = 0; i < this.authorityOptions.length; i++) {
          if(this.authorityOptions[i].deptId == this.userForm.supervisoryCode){
            isSupervisory = true;
          }
        }
        console.log(isSupervisory)
        if(!isSupervisory){
          this.$message({
            message: '请选择正确的主管单位！',
            type: 'error'
          })
          return;
        }
        if (valid) {
          stSaveBase(this.userForm).then(response => {
            this.$message({
              message: '基本信息保存成功！',
              type: 'success'
            })
            this.getInfo()
          })
        } else {
          this.$message({
            message: '请按规定填写完整！',
            type: 'error'
          })
        }
      })

    },
    getInfo() {
      getTableInfoByPage(1).then(response => {
        this.userForm = JSON.parse(JSON.stringify(response.data).replace(/null/g, '""'))
        this.userForm.examineYear = localStorage.getItem('examineYear')
        this.userForm.creditCode = localStorage.getItem('creditCode')
        this.userForm.organizationBaseName = localStorage.getItem('userName')
        this.userForm.legalRepresentativePost += ''
        if (this.userForm.unitNature == '0') {
          this.userForm.unitNature = '';
        } else {
          this.userForm.unitNature += '';
        }
        if (this.userForm.rulesProvidePowerDept != null && this.userForm.rulesProvidePowerDept != '') {
          this.userForm.rulesProvidePowerDept = Number(this.userForm.rulesProvidePowerDept)
        } else {
          this.userForm.rulesProvidePowerDept = ''
        }

        if (this.userForm.rulesProvidePowerDept != null && this.userForm.rulesProvidePowerDept != '') {
          this.userForm.rulesProvidePowerDept = Number(this.userForm.rulesProvidePowerDept)
        }
        if (this.userForm.secretaryDirectorFullTime != null && this.userForm.secretaryDirectorFullTime != '') {
          this.userForm.secretaryDirectorFullTime = Number(this.userForm.secretaryDirectorFullTime)
        } else {
          this.userForm.secretaryDirectorFullTime = ''
        }
      })
      //获取主管单位
      // getListAuthority().then(response => {
      //   let json = response.data
      //   this.authorityOptions = []
      //   if (json != null) {
      //     for (let i = 0; i < json.length; i++) {
      //       if (json[i].deptName.indexOf('云阳') != -1) {
      //         this.authorityOptions.push({ id: json[i].deptId + '', name: json[i].deptName + '' })
      //       }
      //     }
      //     let delStr = ['镇', '领导', '中学', '街道', '支行', '医院', '公司', '集团', '小学', '企业', '银行', '办公室', '乡', '政府', '政协', '责任', '项目', '中队', '人大', '队', '林场', '仓库', '基地', '学校', '三员', '市直', '管理', '网格', '研究', '学院', '群房', '党商', '烟草', '厂商', '政务'];
      //     // let delStr = ['小学','中学','医院','公司','领导','学校','中队','镇','银行', '办公室', '乡', '政府', '政协','街道','中心','支队','责任'];
      //     for (let i = 0; i < delStr.length; i++) {
      //       for (let j = 0; j < this.authorityOptions.length; j++) {
      //         if (this.authorityOptions[j].name.indexOf(delStr[i]) >= 0) {
      //           this.authorityOptions.splice(j, 1);
      //           j--;
      //         }
      //       }
      //     }
      //   }
      //   console.log(this.authorityOptions)
      // })
      getAuthorityDept().then(response => {
        this.authorityOptions = response.data;
        // this.authorityOptions.push({"deptId":"GO_1560457202370744320","id":"65883","deptName": "云阳县工商联","parentId": "GO_1657988536883802112"});
      })
      //政治面貌politics 学历xueli
      getDictByCode('politics').then(response => {
        this.politicsOptions = response.data
      })
      getDictByCode('xueli').then(response => {
        this.xueliOptions = response.data
      })
      //秘书长产生方式
      getDictByCode('secretaryPromotion').then(response => {
        this.secretaryPromotionOptions = response.data
      })
      //社团职务
      getDictByCode('clubPositions').then(response => {
        this.clubPositionsOptions = response.data
      })
      //行业分类
      getDictByCode('industryClass').then(response => {
        this.industryClassOptions = response.data
      })
      //社会组织类型
      getDictByCode('socialOrganizationType').then(response => {
        this.socialOrganizationTypeOptions = response.data
      })
    }
  }
}
</script>
<style scoped lang="scss">
.el-table {
  --el-table-row-hover-bg-color: rgba(39, 137, 238, 0.1);
  --el-table-border-color: #e0e5f0;
}

:deep(.el-card.is-always-shadow) {
  box-shadow: 0 1px 14px 0 rgba(209, 224, 239, 0.6)
}

:deep(.el-radio) {
  display: inline-flex;
}

/* 拉框选中 */
.el-select-dropdown__item {
  height: 24px;
  line-height: 24px;
  font-size: 12px;
}

/* 鼠标经过下拉框 */
.el-select-dropdown__item:hover {
  height: 24px;
  line-height: 24px;
  font-size: 12px;
}

.el-select-dropdown__item.selected {
  color: #2789EE;
}

.app-container {
  margin-top: 40px;
  margin-left: 15%;
  width: 70%;
}

.div-bg {
  width: 100%;
  background: #F0F0F0;
  height: 10px;
}

.box-card {
  width: 100%;
  margin-top: 20px;
  padding: 20px;
}

.el-col {
  padding-left: 5px;
}

.divider-title {
  font-weight: bold;
  font-size: 18px;
}

.custom-select .el-select-dropdown {
  max-height: 600px;
  /* 设置为你想要的高度 */
  overflow: auto;
  /* 添加滚动条 */
}

table {
  border-collapse: collapse;
  /* 确保表格的边框合并为单一边框 */
  width: 100%;
  /* 表格宽度 */
}

td {
  border: 1px solid #ababab;
  /* 设置单线边框 */
  padding: 6px;
  /* 单元格内边距 */
}

.el-form-item {
  margin-bottom: 0px;
}

:deep(.el-form-item__label) {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  text-align: right;
  height: 32px;
  line-height: 16px;
}
</style>
